import { Profile } from "@/types/user";

const PROFILT_KEY = "rabbit-pc-profile-2";

// 1.设置个人信息
export const setProfile = (profile: Profile): void => {
  localStorage.setItem(PROFILT_KEY, JSON.stringify(profile));
};

// 2. 获取个人信息
export const getProfile = (): Profile => {
  return JSON.parse(localStorage.getItem(PROFILT_KEY) || "{}");
};

// 3. 删除个人信息
export const removeProfile = (): void => {
  localStorage.removeItem(PROFILT_KEY);
};
